<template>
	<view>
		<redpacketrain
			:redpackets="reds"
			@clickRedPacket="clickRedPacket"
		></redpacketrain>
	</view>
</template>

<script>
import redpacketrain from '@/components/redpacketrain/redpacketrain.vue';

export default {
	components: {
		redpacketrain
	},
	data() {
		return {
			reds: []
		};
	},
	mounted() {
		const tempArr = [];
		for (let i = 0; i < 100; i++) {
			const redsItem = {
				id: Math.random() * 100,
				value: parseInt(Math.random() * 100)
			};
			tempArr.push(redsItem);
		}
		this.reds = tempArr;
	},
	methods:{
		clickRedPacket(item) {
			console.log(item);
		}
	}
};
</script>

<style lang="less"></style>
